$(function(){
	pageRender();
	$.ajax({
		type: "POST",
		url: "/kingticket/movie/fetchOpeningMovie",
		data: {fetch: 8},
		dataType: "json",
		success: function (data) {
			hotList.$data.items = data.data;
		},
		error:function(data){
			alert("error");
		}
	});

	$.ajax({
		type: "POST",
		url: " /kingticket/movie/fetchWaitingMovie",
		data: {fetch: 8},
		dataType: "json",
		success: function (data) {
			upList.$data.items = data.data;
		},
		error:function(data){
			alert("error");
		}
	});
});

// 正在热映、即将上映切换
var pageRender = function(){
	$('.movie-control>a:nth-of-type(1)').on('click',function(){
		$('.current').removeClass('current');
		$(this).addClass('current');
	});
	$('.movie-control>a:nth-of-type(2)').on('click',function(){
		$('.current').removeClass('current');
		$(this).addClass('current');
	});
}
var movieCarde = Vue.component('movie-modele',{
	props: ['movieData'],
	template: '#tem-movie'
});

var upList = new Vue({
	el: '#film-up',
	data:{
		items: data
	},
	methods:{
		getData: function(index){
			return this.items[index];
		}
	}
});
